﻿using Newtonsoft.Json;
using Newtonsoft.Json.Converters;

namespace XSot.BitBrowser.LocalApiClient.Model
{
    public class BitBrowserFingerPrint
    {
        /// <summary>
        /// 浏览器内核（chrome | firefox，默认chrome，需要火狐内核时，填firefox）
        /// </summary>
        [JsonProperty("coreProduct")]
        [JsonConverter(typeof(StringEnumConverter))]
        public BitBrowserCoreProduct CoreProduct { get; set; } = BitBrowserCoreProduct.Chrome;
        /// <summary>
        /// 内核版本，chrome 内核默认 版本最新，firefox内核默认 128，所有内核版本，参考客户端界面内可选值
        /// </summary>
        [JsonProperty("coreVersion")]
        public string? CoreVersion { get; set; }
        /// <summary>
        /// 操作系统平台 PC | Android | IOS
        /// </summary>
        [JsonProperty("ostype")]
        [JsonConverter(typeof(StringEnumConverter))]
        public BitBrowserOSType OSType { get; set; } = BitBrowserOSType.PC;
        /// <summary>
        /// navigator.platform值，严格与操作系统一一对应, Windows => Win32, macOS => MacIntel, Linux => Linux x86_64, iOS => iPhone, Android => Linux armv81
        /// </summary>
        [JsonProperty("os")]
        [JsonConverter(typeof(StringEnumConverter))]
        public BitBrowserOS OS { get; set; } = BitBrowserOS.Windows;
        /// <summary>
        /// 操作系统版本，不填时，按照os随机，填了以后，按照所填的值范围内随机，windows候选项 11,10，Android候选项14,13,12,11,10,9，iOS候选 17.0,16.6,16.5,16.4,16.3,16.2,16.1,16.0,15.7,15.6,15.5,15.4,15.3,15.2,15.1,15.0，可填多个值，逗号分隔，比如windows: '11,10'
        /// </summary>
        [JsonProperty("osVersion")]
        public string? OSVersion { get; set; }
        /// <summary>
        /// ua，不填则自动生成
        /// </summary>
        [JsonProperty("userAgent")]
        public string? UserAgent { get; set; }
        /// <summary>
        /// 基于IP生成对应的时区
        /// </summary>
        [JsonProperty("isIpCreateTimeZone")]
        public bool IsIpCreateTimeZone { get; set; }
        /// <summary>
        /// 时区，isIpCreateTimeZone 为false时，参考附录中的时区列表
        /// </summary>
        [JsonProperty("timeZone")]
        public string? TimeZone { get; set; }
        /// <summary>
        /// isIpCreateTimeZone 为false时设置，时区偏移量
        /// </summary>
        [JsonProperty("timeZoneOffset")]
        public int TimeZoneOffset { get; set; } = 0;
        /// <summary>
        /// webrtc 0 => 替换, 1 => 允许, 2 => 禁止, 3 => 隐私
        /// </summary>
        [JsonProperty("webRTC")]
        public string WebRTC { get; set; } = "3";
        /// <summary>
        /// 忽略https证书错误，true, false
        /// </summary>
        [JsonProperty("ignoreHttpsErrors")]
        public bool IgnoreHttpsErrors { get; set; } = false;
        /// <summary>
        /// 地理位置 0 => 询问, 1 => 允许, 2 => 禁止
        /// </summary>
        [JsonProperty("position")]
        public string? Position { get; set; } = "1";
        /// <summary>
        /// 是否基于IP生成对应的地理位置
        /// </summary>
        [JsonProperty("isIpCreatePosition")]
        public bool IsIpCreatePosition { get; set; } = true;
        /// <summary>
        /// 纬度 isIpCreatePosition 为false时设置
        /// </summary>
        [JsonProperty("lat")]
        public string? Lat { get; set; }
        /// <summary>
        /// 经度 isIpCreatePosition 为false时设置
        /// </summary>
        [JsonProperty("lng")]
        public string? Lng { get; set; }
        /// <summary>
        /// 精度米 isIpCreatePosition 为false时设置
        /// </summary>
        [JsonProperty("precisionData")]
        public string? PrecisionData { get; set; }
        /// <summary>
        /// 是否基于IP生成对应国家的浏览器语言
        /// </summary>
        [JsonProperty("isIpCreateLanguage")]
        public bool IsIpCreateLanguage { get; set; } = true;
        /// <summary>
        /// isIpCreateLanguage 为false时设置，值参考附录
        /// </summary>
        [JsonProperty("languages")]
        public string? Languages { get; set; }
        /// <summary>
        /// 是否基于IP生成对应国家的浏览器界面语言
        /// </summary>
        [JsonProperty("isIpCreateDisplayLanguage")]
        public bool IsIpCreateDisplayLanguage { get; set; } = false;
        /// <summary>
        /// isIpCreateDisplayLanguage 为false时设置，默认为空，即跟随系统，值参考附录
        /// </summary>
        [JsonProperty("displayLanguages")]
        public string? DisplayLanguages { get; set; }
        /// <summary>
        /// 窗口宽度，只是设置窗口打开时的尺寸，与指纹无关
        /// </summary>
        [JsonProperty("openWidth")]
        public int OpenWidth { get; set; } = 1280;
        /// <summary>
        /// 窗口高度，只是设置窗口打开时的尺寸，与指纹无关
        /// </summary>
        [JsonProperty("openHeight")]
        public int OpenHeight { get; set; } = 720;
        /// <summary>
        /// 分辨率类型 0 => 跟随电脑, 1 => 自定义，默认建议跟随电脑，默认：0
        /// </summary>
        [JsonProperty("resolutionType")]
        public string ResolutionType { get; set; } = "0";
        /// <summary>
        /// 自定义分辨率时，具体值
        /// </summary>
        [JsonProperty("resolution")]
        public string? Resolution { get; set; } = "1920 x 1080";
        /// <summary>
        /// 分辨率类型为自定义，且ostype为PC时，此项有效，约束窗口最大尺寸不超过分辨率
        /// </summary>
        [JsonProperty("windowSizeLimit")]
        public bool WindowSizeLimit { get; set; } = true;
        /// <summary>
        /// 创建者编号
        /// </summary>
        [JsonProperty("createdBy")]
        public string? CreatedBy { get; set; }
        /// <summary>
        /// 创建时间
        /// </summary>
        [JsonProperty("createdTime")]
        public DateTime? CreatedTime { get; set; }
        /// <summary>
        /// 修改时间
        /// </summary>
        [JsonProperty("updateTime")]
        public DateTime? UpdateTime { get; set; }
        /// <summary>
        /// 用户名是否有效
        /// </summary>
        [JsonProperty("isValidUsername")]
        public bool IsValidUsername { get; set; } = true;
        /// <summary>
        /// 是否中止图片加载
        /// </summary>
        [JsonProperty("abortImage")]
        public bool AbortImage { get; set; } = false;
        /// <summary>
        /// 中止图片加载的最大尺寸
        /// </summary>
        [JsonProperty("abortImageMaxSize")]
        public int? AbortImageMaxSize { get; set; } = null;
        /// <summary>
        /// 是否中止媒体加载
        /// </summary>
        [JsonProperty("abortMedia")]
        public bool AbortMedia { get; set; } = false;
        /// <summary>
        /// 网络错误时是否停止
        /// </summary>
        [JsonProperty("stopWhileNetError")]
        public bool StopWhileNetError { get; set; } = false;
        /// <summary>
        /// 国家变化时是否停止
        /// </summary>
        [JsonProperty("stopWhileCountryChange")]
        public bool StopWhileCountryChange { get; set; } = false;
        /// <summary>
        /// 是否同步标签页
        /// </summary>
        [JsonProperty("syncTabs")]
        public bool SyncTabs { get; set; } = true;
        /// <summary>
        /// 是否同步 Cookies
        /// </summary>
        [JsonProperty("syncCookies")]
        public bool SyncCookies { get; set; } = true;
        /// <summary>
        /// 是否同步 IndexedDB
        /// </summary>
        [JsonProperty("syncIndexedDb")]
        public bool SyncIndexedDb { get; set; } = false;
        /// <summary>
        /// 是否同步书签
        /// </summary>
        [JsonProperty("syncBookmarks")]
        public bool SyncBookmarks { get; set; } = false;
        /// <summary>
        /// 是否同步授权信息
        /// </summary>
        [JsonProperty("syncAuthorization")]
        public bool SyncAuthorization { get; set; } = false;
        /// <summary>
        /// 是否同步历史记录
        /// </summary>
        [JsonProperty("syncHistory")]
        public bool SyncHistory { get; set; } = false;
        /// <summary>
        /// 是否同步 Google 账户
        /// </summary>
        [JsonProperty("syncGoogleAccount")]
        public bool SyncGoogleAccount { get; set; } = false;
        /// <summary>
        /// 是否允许登录
        /// </summary>
        [JsonProperty("allowedSignin")]
        public bool AllowedSignin { get; set; } = false;
        /// <summary>
        /// 是否同步会话
        /// </summary>
        [JsonProperty("syncSessions")]
        public bool SyncSessions { get; set; } = false;
        /// <summary>
        /// 工作台类型(localserver|disable)
        /// </summary>
        [JsonProperty("workbench")]
        public string? Workbench { get; set; } = "localserver";
        /// <summary>
        /// 启动前是否清除缓存文件
        /// </summary>
        [JsonProperty("clearCacheFilesBeforeLaunch")]
        public bool ClearCacheFilesBeforeLaunch { get; set; } = false;
        /// <summary>
        /// 启动前是否清除 Cookies
        /// </summary>
        [JsonProperty("clearCookiesBeforeLaunch")]
        public bool ClearCookiesBeforeLaunch { get; set; } = false;
        /// <summary>
        /// 启动前是否清除历史记录
        /// </summary>
        [JsonProperty("clearHistoriesBeforeLaunch")]
        public bool ClearHistoriesBeforeLaunch { get; set; } = false;
        /// <summary>
        /// 是否启用随机指纹
        /// </summary>
        [JsonProperty("randomFingerprint")]
        public bool RandomFingerprint { get; set; } = false;
        /// <summary>
        /// 是否静音
        /// </summary>
        [JsonProperty("muteAudio")]
        public bool MuteAudio { get; set; } = false;
        /// <summary>
        /// 是否禁用 GPU
        /// </summary>
        [JsonProperty("disableGpu")]
        public bool DisableGpu { get; set; } = false;
        /// <summary>
        /// 是否启用后台模式
        /// </summary>
        [JsonProperty("enableBackgroundMode")]
        public bool EnableBackgroundMode { get; set; } = false;
        /// <summary>
        /// 是否同步扩展
        /// </summary>
        [JsonProperty("syncExtensions")]
        public bool SyncExtensions { get; set; } = false;
        /// <summary>
        /// 是否同步用户扩展
        /// </summary>
        [JsonProperty("syncUserExtensions")]
        public bool SyncUserExtensions { get; set; } = false;
        /// <summary>
        /// 是否同步本地存储
        /// </summary>
        [JsonProperty("syncLocalStorage")]
        public bool SyncLocalStorage { get; set; } = false;
        /// <summary>
        /// 是否启用凭证服务
        /// </summary>
        [JsonProperty("credentialsEnableService")]
        public bool CredentialsEnableService { get; set; } = false;
        /// <summary>
        /// 是否禁用翻译弹窗
        /// </summary>
        [JsonProperty("disableTranslatePopup")]
        public bool DisableTranslatePopup { get; set; } = false;
        /// <summary>
        /// IP 变化时是否停止
        /// </summary>
        [JsonProperty("stopWhileIpChange")]
        public bool StopWhileIpChange { get; set; } = false;
        /// <summary>
        /// 是否禁用剪贴板
        /// </summary>
        [JsonProperty("disableClipboard")]
        public bool DisableClipboard { get; set; } = false;
        /// <summary>
        /// 是否禁用通知
        /// </summary>
        [JsonProperty("disableNotifications")]
        public bool DisableNotifications { get; set; } = false;
        /// <summary>
        /// 省内存模式，开启后有可能会导致部分异常，不建议开启，默认 false
        /// </summary>
        [JsonProperty("memorySaver")]
        public bool? MemorySaver { get; set; }
        /// <summary>
        /// webgpu
        /// </summary>
        [JsonProperty("webgpu")]
        public Dictionary<string, string>? WebgPu { get; set; }
        /// <summary>
        /// BatchUpdateFingerPrint
        /// </summary>
        [JsonProperty("batchUpdateFingerPrint")]
        public bool? BatchUpdateFingerPrint { get; set; }
        /// <summary>
        /// FirefoxVersionMap
        /// </summary>
        [JsonProperty("firefoxVersionMap")]
        public Dictionary<string, string>? FirefoxVersionMap { get; set; }
        /// <summary>
        /// BatchRandom
        /// </summary>
        [JsonProperty("batchRandom")]
        public bool? BatchRandom { get; set; }
        /// <summary>
        /// 显示缩放比例，默认1，填写时，建议 1, 1.5, 2, 2.5, 3
        /// </summary>
        [JsonProperty("devicePixelRatio")]
        public double DevicePixelRatio { get; set; } = 1;
        /// <summary>
        /// 字体生成类型 0 => 系统默认 | 1 => 自定义 | 2=>随机匹配，默认：2
        /// </summary>
        [JsonProperty("fontType")]
        public string? FontType { get; set; } = "2";
        /// <summary>
        /// 自定义或随机匹配时，设置的字体值，值参考附录字体
        /// </summary>
        [JsonProperty("font")]
        public string? Font { get; set; }
        /// <summary>
        /// canvas 0随机｜1关闭，默认：0
        /// </summary>
        [JsonProperty("canvas")]
        public string? Canvas { get; set; }
        /// <summary>
        /// CanvasValue
        /// </summary>
        [JsonProperty("canvasValue")]
        public string? CanvasValue { get; set; }
        /// <summary>
        /// webGL图像，0随机｜1关闭，默认：0
        /// </summary>
        [JsonProperty("webGL")]
        public string? WebGL { get; set; }
        /// <summary>
        /// WebGLValue
        /// </summary>
        [JsonProperty("webGLValue")]
        public string? WebGLValue { get; set; }
        /// <summary>
        /// webgl元数据 0自定义｜1关闭，默认：0
        /// </summary>
        [JsonProperty("webGLMeta")]
        public string? WebGLMeta { get; set; }
        /// <summary>
        /// webGLMeta 自定义时，webGL厂商值，建议留空会自动生成
        /// </summary>
        [JsonProperty("webGLManufacturer")]
        public string? WebGLManufacturer { get; set; }
        /// <summary>
        /// webGLMeta自定义时，webGL渲染值，建议留空自动生成
        /// </summary>
        [JsonProperty("webGLRender")]
        public string? WebGLRender { get; set; }
        /// <summary>
        /// audioContext值，0随机｜1关闭，默认：0
        /// </summary>
        [JsonProperty("audioContext")]
        public string? AudioContext { get; set; }
        /// <summary>
        /// AudioContextValue
        /// </summary>
        [JsonProperty("audioContextValue")]
        public string? AudioContextValue { get; set; }
        /// <summary>
        /// MediaDevice
        /// </summary>
        [JsonProperty("mediaDevice")]
        public string? MediaDevice { get; set; }
        /// <summary>
        /// 语言数据
        /// </summary>
        [JsonProperty("speechVoicesValue")]
        public string? SpeechVoicesValue { get; set; }
        /// <summary>
        /// Speech Voices，0随机｜1关闭
        /// </summary>
        [JsonProperty("speechVoices")]
        public string? SpeechVoices { get; set; }
        /// <summary>
        /// 硬件并发数
        /// </summary>
        [JsonProperty("hardwareConcurrency")]
        public string? HardwareConcurrency { get; set; }
        /// <summary>
        /// 设备内存，4，8，不要传入大于8的值
        /// </summary>
        [JsonProperty("deviceMemory")]
        public string? DeviceMemory { get; set; }
        /// <summary>
        /// doNotTrack 1开启｜0关闭
        /// </summary>
        [JsonProperty("doNotTrack")]
        public string? DoNotTrack { get; set; }
        /// <summary>
        /// ClientRects true使用相匹配的值代替您真实的ClientRects | false每个浏览器使用当前电脑默认的ClientRects
        /// </summary>
        [JsonProperty("clientRectNoiseEnabled")]
        public bool ClientRectNoiseEnabled { get; set; } = true;
        /// <summary>
        /// ClientRectNoiseValue
        /// </summary>
        [JsonProperty("clientRectNoiseValue")]
        public int? ClientRectNoiseValue { get; set; }
        /// <summary>
        /// 端口扫描保护 0开启｜1关闭，默认值：0，注意默认开启保护，组织所有本地127的ws链接，比如某些打印机之类的，如有连接本地服务需求，建议关闭，或者在 portWhiteList 中，填写对应端口，加入白名单
        /// </summary>
        [JsonProperty("portScanProtect")]
        public string? PortScanProtect { get; set; }
        /// <summary>
        /// 端口扫描保护开启时的白名单，逗号分隔
        /// </summary>
        [JsonProperty("portWhiteList")]
        public string? PortWhiteList { get; set; }
        /// <summary>
        /// 是否删除（0：没有|1：删除）
        /// </summary>
        [JsonProperty("isDelete")]
        public int? IsDelete { get; set; }
        /// <summary>
        /// 颜色深度
        /// </summary>
        [JsonProperty("colorDepth")]
        public int? ColorDepth { get; set; }
        /// <summary>
        /// 硬盘大小
        /// </summary>
        [JsonProperty("totalDiskSpace")]
        public ulong? TotalDiskSpace { get; set; }
        /// <summary>
        /// 自定义设备信息，默认开启
        /// </summary>
        [JsonProperty("deviceInfoEnabled")]
        public bool DeviceInfoEnabled { get; set; } = true;
        /// <summary>
        /// deviceInfoEnabled 为true时设置，建议留空系统自动生成即可
        /// </summary>
        [JsonProperty("computerName")]
        public string? ComputerName { get; set; }
        /// <summary>
        /// deviceInfoEnabled 为true时设置，建议留空系统自动生成即可
        /// </summary>
        [JsonProperty("macAddr")]
        public string? MacAddr { get; set; }
        /// <summary>
        /// ssl是否禁用特性，默认不禁用，注意开启后自定义设置时，有可能会导致某些网站无法访问
        /// </summary>
        [JsonProperty("disableSslCipherSuitesFlag")]
        public bool DisableSslCipherSuitesFlag { get; set; } = false;
        /// <summary>
        /// ssl 禁用特性，序列化的ssl特性值，参考附录，逗号分隔值
        /// </summary>
        [JsonProperty("disableSslCipherSuites")]
        public string? DisableSslCipherSuites { get; set; }
        /// <summary>
        /// 是否启用插件指纹
        /// </summary>
        [JsonProperty("enablePlugins")]
        public bool EnablePlugins { get; set; } = false;
        /// <summary>
        /// enablePlugins为true时，序列化的插件值，插件指纹值参考附录
        /// </summary>
        [JsonProperty("plugins")]
        public string? Plugins { get; set; }
        /// <summary>
        /// 启动参数，如无痕模式打开，那么设置启动参数为 "--incognito", 多个启动参数用逗号分隔，如 "--incognito,--no-sandbox"
        /// </summary>
        [JsonProperty("launchArgs")]
        public string? LaunchArgs { get; set; }
        /// <summary>
        /// 默认电量
        /// </summary>
        [JsonProperty("defaultAccuracy")]
        public int? DefaultAccuracy { get; set; }
    }
}
